Binding constructs

The three binding constructs let, let*, and letrec give Scheme a block structure, like Algol 60. The syntax of the three constructs is identical, but they differ in the regions they establish for their variable bindings. In a let expression, the initial values are computed before any of the variables become bound; in a let* expression, the bindings and evaluations are performed sequentially; while in a letrec expression, all the bindings are in effect while their initial values are being computed, thus allowing mutually recursive definitions.


\begin{entry}
% latex2html id marker 272
{%
\proto{let}{ \hyper{bindings} \hyper...
...d{scheme}\par
See also named \ide{let}, section \ref{namedlet}.
\par
\end{entry}


\begin{entry}{%
\proto{let*}{ \hyper{bindings} \hyper{body}}{\exprtype}}\nobreak...
...(y 3))
(let* ((x 7)
(z (+ x y)))
(* z x))) \ev 70\end{scheme}\par
\end{entry}


\begin{entry}{%
\proto{letrec}{ \hyper{bindings} \hyper{body}}{essential \exprty...
...e
\lambdaexp{}s and the restriction is satisfied automatically.
\par
\end{entry}